package com.example.myapplication;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import androidx.appcompat.app.AppCompatActivity;

public class Login extends AppCompatActivity {
    EditText mEtUserName,mEtPassWord;
    Button mBtnEnter;
    private static final String TAG = "Login";
    String name,password1;
    int status;
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.login_layout);
//        初始化控件
        initView();
//        事件处理
        initEvent();
    }

    //    为mBtnEnter按钮添加点击事件
    private void initEvent() {
        mBtnEnter.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
//                通过getText()方法来存储用户输入的信息
                String username = String.valueOf(mEtUserName.getText());
                String password = String.valueOf(mEtPassWord.getText());
            }
        });
    }

    //    绑定控件
    private void initView() {
        mEtUserName = findViewById(R.id.et_username);
        mEtPassWord = findViewById(R.id.et_password);
        mBtnEnter = findViewById(R.id.btn_zhuce);
    }
}
